package br3akr.DeadlyDinnerParty.Server.Actions;

import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;

import br3akr.DeadlyDinnerParty.Server.Engine.RecoveryTask;
import br3akr.DeadlyDinnerParty.Server.Engine.Session;
import br3akr.DeadlyDinnerParty.Server.Exceptions.DeadlyDinnerPartyException;
import br3akr.DeadlyDinnerParty.Server.World.GameCharacter;

public abstract class Action {

    private boolean isFree;

    public Action (String commandName, boolean isFree) {
        this.isFree = isFree;
    }
    
    public abstract ActionResponse doAction (String action, Session session) throws DeadlyDinnerPartyException;
    
    public abstract ActionResponse getActionResponse();

	public abstract Set<String> getKeywords();
    
    public boolean isFree() {
    	return isFree;
    }
    
    public void beginRecovery(GameCharacter character, long time) {
    	character.setRecovering(true);
		TimerTask task = new RecoveryTask(character);
		Timer timer = new Timer();
		timer.schedule(task, time);
    }
}